package openhaven;

public class StringUtil
{
    public static String tokenSeparated(final String token, final String... strings)
    {
        final StringBuffer buf = new StringBuffer();
        for (final String string : strings)
        {
            buf.append(string);
            buf.append(token);
        }
        // NOTE: trim probably causes a bug here but meh
        return buf.toString().trim();
    }

    public static String tokenSeparated(final String token, final Object[] strings)
    {
        final StringBuffer buf = new StringBuffer();
        for (final Object string : strings)
        {
            buf.append(string);
            buf.append(token);
        }
        // NOTE: trim probably causes a bug here but meh
        return buf.toString().trim();
    }
}
